import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Opportunity from '../liujin/Opportunity'
import OpportunityView from '../liujin/OpportunityView'
import CustomerDemand from '../liujin/CustomerDemand'
import Solution from '../liujin/Solution'
import Competitor from '../liujin/Competitor'
import Quotation from '../liujin/Quotation'
import QuotationView from '../liujin/QuotationView'
import SalesFunnel from '../liujin/SalesFunnel'
import BusinessTrip from '@/liujin/BusinessTrip'
import Approval from '@/liujin/Approval'
import Task from '@/liujin/Task'
import ApprovalView from '@/liujin/ApprovalView'
import BusinessTripView from '../liujin/BusinessTripView'
import TaskView from '../liujin/TaskView'
import Purchase from '../liujin/Purchase'
import PurchaseView from '../liujin/PurchaseView'
import Storage from '../liujin/Storage'
import Inventory from '../liujin/Inventory'
import Outbound from '../liujin/Outbound'
import StorageView from '../liujin/StorageView'
import InventoryFlow from '../liujin/InventoryFlow'
import PurchaseDetails from '../liujin/PurchaseDetails'
import PrintQuotation from "../liujin/PrintQuotation";
import PrintContract from '@/cyj/PrintContract'
import PrintPurchase from "../liujin/PrintPurchase";
import Contract from '@/cyj/Contract'
import DeliveryPlanView from '@/cyj/DeliveryPlanView'
import DeliveryPlan from '@/cyj/DeliveryPlan'
import DeliveryRecord from '@/cyj/DeliveryRecord'
import DeliveryRecordView from '@/cyj/DeliveryRecordView'
import PlannedPayment from '@/cyj/PlannedPayment'
import PlannedPaymentView from '@/cyj/PlannedPaymentView'
import Invoice from '@/cyj/Invoice'
import Return from '@/cyj/Return'
import ListItem from '@/cyj/ListItem'
import PlanReceivable from '@/cyj/PlanReceivable'
import PlanReceivableView from '@/cyj/PlanReceivableView'
import Payment from '@/cyj/Payment'
import PaymentInvoice from '@/cyj/PaymentInvoice'
import PaymentInvoiceView from '@/cyj/PaymentInvoiceView'
import ReceivableRecords from '@/cyj/ReceivableRecords'
import ReceivableRecordsView from '@/cyj/ReceivableRecordsView'
import RecordInvoice from '@/cyj/RecordInvoice'
import ContractView from '@/cyj/ContractView'
import Workbench from '@/components/Workbench'
import Customer from '../byh/Customer'
import CustomerView from '../byh/CustomerView'
import Contact from '../byh/Contact'
import Jurisdiction from '../wm/Jurisdiction'
import AlterInfo from '../wm/AlterInfo'
import Login from '../wm/Login'
import Maintenance from '../lijuan/Maintenance'
import ProductClassify from '../lijuan/ProductClassify'
import MaintenanceView from '../lijuan/MaintenanceView'
import QA from '../lijuan/QA'
import Complain from '../lijuan/Complain'
import CustomerCare from '../lijuan/CustomerCare'
import CustomerService from '../lijuan/CustomerService'
import MaintenanceConsole from '../lijuan/MaintenanceConsole'
import Product from '../lijuan/Product'
import ProductView from '../lijuan/ProductView'

// 解决Vue前端的Session问题
import axios from 'axios'
axios.defaults.withCredentials = true
// 添加一个响应拦截器，将  res.data -> data
axios.interceptors.response.use(function (response) {
  return response
}, function (error) {
  return Promise.reject(error)
})

Vue.use(Router)

export default new Router({
  mode: 'history', // 去掉地址中的#号
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    }, {
      path: '/hello',
      name: 'HelloWorld',
      component: HelloWorld,
      children: [ {
        path: '/opportunity',
        name: 'Opportunity',
        component: Opportunity
      }, {
        path: '/opportview',
        name: 'OpportunityView',
        component: OpportunityView
      }, {
        path: '/customerdemand',
        name: 'CustomerDemand',
        component: CustomerDemand
      }, {
        path: '/solution',
        name: 'Solution',
        component: Solution
      }, {
        path: '/competitor',
        name: 'Competitor',
        component: Competitor
      }, {
        path: '/quotation',
        name: 'Quotation',
        component: Quotation
      }, {
        path: '/quotationview',
        name: 'QuotationView',
        component: QuotationView
      }, {
        path: '/salesfunnel',
        name: 'SalesFunnel',
        component: SalesFunnel
      }, {
        path: '/contract',
        name: 'Contract',
        component: Contract
      }, {
        path: '/customer',
        name: 'Customer',
        component: Customer
      }, {
        path: '/customerview',
        name: 'CustomerView',
        component: CustomerView
      }, {
        path: '/contractview',
        name: 'ContractView',
        component: ContractView
      }, {
        path: '/deliveryplan',
        name: 'DeliveryPlan',
        component: DeliveryPlan
      }, {
        path: '/deliveryplanview',
        name: 'DeliveryPlanView',
        component: DeliveryPlanView
      }, {
        path: '/deliveryrecord',
        name: 'DeliveryRecord',
        component: DeliveryRecord
      }, {
        path: '/deliveryrecordview',
        name: 'DeliveryRecordView',
        component: DeliveryRecordView
      }, {
        path: '/plannedpayment',
        name: 'PlannedPayment',
        component: PlannedPayment
      }, {
        path: '/plannedpaymentview',
        name: 'PlannedPaymentView',
        component: PlannedPaymentView
      }, {
        path: '/invoice',
        name: 'Invoice',
        component: Invoice
      }, {
        path: '/return',
        name: 'Return',
        component: Return
      }, {
        path: '/listitem',
        name: 'ListItem',
        component: ListItem
      }, {
        path: '/planreceivable',
        name: 'PlanReceivable',
        component: PlanReceivable
      }, {
        path: '/planreceivableview',
        name: 'PlanReceivableView',
        component: PlanReceivableView
      }, {
        path: '/payment',
        name: 'Payment',
        component: Payment
      }, {
        path: '/recordinvoice',
        name: 'RecordInvoice',
        component: RecordInvoice
      }, {
        path: '/paymentinvoice',
        name: 'PaymentInvoice',
        component: PaymentInvoice
      }, {
        path: '/paymentinvoiceview',
        name: 'PaymentInvoiceView',
        component: PaymentInvoiceView
      }, {
        path: '/receivablerecords',
        name: 'ReceivableRecords',
        component: ReceivableRecords
      }, {
        path: '/receivablerecordsview',
        name: 'ReceivableRecordsView',
        component: ReceivableRecordsView
      }, {
        path: '/businesstrip',
        name: 'BusinessTrip',
        component: BusinessTrip
      }, {
        path: '/approval',
        name: 'Approval',
        component: Approval
      }, {
        path: '/task',
        name: 'Task',
        component: Task
      }, {
        path: '/contractview',
        name: 'ContractView',
        component: ContractView
      }, {
        path: '/workbench',
        name: 'Workbench',
        component: Workbench
      }, {
        path: '/jurisdiction',
        name: 'Jurisdiction',
        component: Jurisdiction
      }, {
        path: '/alterinfo',
        name: 'AlterInfo',
        component: AlterInfo
      }, {
        path: '/login',
        name: 'Login',
        component: Login
      }, {
        path: '/maintenance',
        name: 'Maintenance',
        component: Maintenance
      }, {
        path: '/productClassify',
        name: 'ProductClassify',
        component: ProductClassify
      }, {
        path: '/maintenanceview',
        name: 'MaintenanceView',
        component: MaintenanceView
      }, {
        path: '/qa',
        name: 'QA',
        component: QA
      }, {
        path: '/complain',
        name: 'Complain',
        component: Complain
      }, {
        path: '/customercare',
        name: 'CustomerCare',
        component: CustomerCare
      }, {
        path: '/customerservice',
        name: 'CustomerService',
        component: CustomerService
      }, {
        path: '/maintenanceconsole',
        name: 'MaintenanceConsole',
        component: MaintenanceConsole
      }, {
        path: '/product',
        name: 'Product',
        component: Product
      }, {
        path: '/productview',
        name: 'ProductView',
        component: ProductView
      }, {
        path: '/approvalview',
        name: 'ApprovalView',
        component: ApprovalView
      }, {
        path: '/businessview',
        name: 'BusinessTripView',
        component: BusinessTripView
      }, {
        path: '/contact',
        name: 'Contact',
        component: Contact
      }, {
        path: '/taskview',
        name: 'TaskView',
        component: TaskView
      }, {
        path: '/purchase',
        name: 'Purchase',
        component: Purchase
      }, {
        path: '/purchaseview',
        name: 'PurchaseView',
        component: PurchaseView
      }, {
        path: '/storage',
        name: 'Storage',
        component: Storage
      }, {
        path: '/inventory',
        name: 'Inventory',
        component: Inventory
      }, {
        path: '/outbound',
        name: 'Outbound',
        component: Outbound
      }, {
        path: '/storageview',
        name: 'StorageView',
        component: StorageView
      }, {
        path: '/inventoryflow',
        name: 'InventoryFlow',
        component: InventoryFlow
      }, {
        path: '/purchasedetails',
        name: 'PurchaseDetails',
        component: PurchaseDetails
      }, {
        path: '/printquotation',
        name: 'printquotation',
        component: PrintQuotation
      },{
        path: '/printcontract',
        name: 'printcontract',
        component: PrintContract
      }, {
        path: '/printpurchase',
        name: 'PrintPurchase',
        component: PrintPurchase
      }]
    }
  ]
})
